﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class NVDangNhap : System.Web.UI.Page
{
    QLNV nv = new QLNV();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        bool success = nv.checkAccount(txtId.Text, txtPwd.Text);
        if (success)
        {
            Session["name"] = txtId.Text;
            Response.Redirect("~/TrangChu.aspx");
        }
        else
        {
            //lblMessage.Text = "No match for Username and/or Password.";
            this.Page.ClientScript.RegisterStartupScript(this.GetType(),"CheckLogin", "alert('Username or Password is incorrect !!')", true);
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        txtId.Text = "";
        txtPwd.Text = "";
    }
}